package com.zxx.yuanze.isp;

import java.io.Closeable;
import java.io.IOException;

/**
 * ISP 接口隔离原则
 * @author zxx on 2020/12/8
 */
public class CloseUtils {

    private CloseUtils() {
    }

    /**
     * 关闭Closeable对象
     * 用法：finally { CloseUtils.closeQuietly( inputStream ); }
     */
    public static void closeQuietly(Closeable closeable){
        if (null != closeable) {
            try {
                closeable.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
